<template>
  <!-- 车源 -->
  <view class="cheyuancss">
    <u-sticky offset-top="0">
      <view class="search-bar">
        <u-search :show-action="true" @search="search" @custom="custom" @clear="clear" :clearabled="true" :animation="true"
          placeholder="搜索品牌/系列/车子" bg-color="#fff" v-model="searchfor"></u-search>
      </view>
    </u-sticky>
    <view class="top-bar">
      <view class="li" @click="fabuxcclick('/pages_carSource/releaseOptions/releaseOptions')">
        <view class="icon">
          <i-icon icon="iconfabunew" type="multiple" size="80rpx"></i-icon>
        </view>
        <view class="name">发布车源</view>
      </view>
      <view class="li" @click="fabuxcclick('/pages_carSource/managementOptions/managementOptions')">
        <!-- commodityManagement -->
        <view class="icon">
          <i-icon icon="iconguanli1" type="multiple" size="80rpx"></i-icon>
        </view>
        <view class="name">管理车源</view>
      </view>
      <view class="li" @click="fabuxcclick('/pages_order/orderAdmin/orderAdmin')">
        <view class="icon">
          <i-icon icon="iconwodedingdan" type="multiple" size="80rpx"></i-icon>
        </view>
        <view class="name">我的订单</view>
      </view>
    </view>
    <view class="echart" v-show="showdatefalse">
      <view class="tool-group">
        <!-- <view class="title">
          <view class="left">我的车源
            <text class="gray">（在售{{sales}}条）</text>
          </view>
          <view class="right" @tap="gotoSxy">管理车源
            <u-icon name="arrow-right" color="#9A9A9A" size="24rpx"></u-icon>
          </view>
        </view> -->
        <!-- 今天昨天过去7天 -->
        <view class="time">
          <view :class="item.checked?'li active':'li'" v-for="(item,index) in timeList" :key="index" @click="chooseTime(index)">
            {{item.name}}
          </view>
        </view>
        <!-- 统计 -->
        <view class="chart">
          <view class="top">
            <view class="scale">
              <view class="scale-li" v-for="(item,index) in scaleList" :key="index">
                {{item}}
                <view class="icon">
                  <image src="https://files.yzsheng.com/bussiness/imgs/xianddd.png" mode="aspectFit"></image>
                </view>
              </view>
            </view>
            <view class="content">
              <view class="line">
                <view class="bar-line">
                  <view class="num">
                    <view class="number">{{ShowDate.browse}}</view>
                    <view class="icon">
                      <u-icon name="arrow-right" color="#9A9A9A" size="24rpx"></u-icon>
                    </view>
                  </view>
                  <view class="bar" :style="{height:barHeight[0]}"></view>
                </view>
              </view>
              <view class="line">
                <view class="bar-line">
                  <view class="num">
                    <view class="number">{{ShowDate.contact}}</view>
                    <view class="icon">
                      <u-icon name="arrow-right" color="#9A9A9A" size="24rpx"></u-icon>
                    </view>
                  </view>
                  <view class="bar" :style="{height:barHeight[1]}"></view>
                </view>
              </view>
              <view class="line">
                <view class="bar-line">
                  <view class="num">
                    <view class="number">{{ShowDate.trading}}</view>
                    <view class="icon">
                      <u-icon name="arrow-right" color="#9A9A9A" size="24rpx"></u-icon>
                    </view>
                  </view>
                  <view class="bar" :style="{height:barHeight[2]}"></view>
                </view>
              </view>
            </view>
          </view>

          <view class="bottom">
            <view class="name" v-for="(item,index) in chartNameList" :key="index">
              {{item}}
            </view>
          </view>
        </view>
      </view>
    </view>
    <view class="list-total">
      <view class="big-title">最新车源</view>
    </view>
    <view class="choose-criteria">
      <view :class="stickyJudgment ? 'swiper-itembgs' : 'swiper-item'">
        <u-sticky :offset-top="zhiding" :h5-nav-height="isHeight" bg-color="none" @fixed="fixed()" @unfixed="unfixed()">
          <view :class="Closefalse ?'topBox':'topBoxst'">
            <!-- class="sticky" -->
            <u-dropdown :close-on-click-mask="mask" @open="open" @close="close" ref="uDropdown" :activeColor="activeColor"
              :borderBottom="borderBottom" duration="200">
              <!-- 置顶u-sticky -->
              <u-dropdown-item title="品牌/配置">
                <view class="slot-content" style="background-color: #FFFFFF;">
                  <scroll-view scroll-y="true" style="height: 60vh;" :scroll-into-view="pptoView">
                    <view class="brandcss" @tap="searchBrandAll">
                      <view :class="allBrands === 1 ? 'allbrancolor' : 'allbran'">全部品牌</view>
                      <view class="carnum">
                        {{brandTotal}}辆
                      </view>
                    </view>
                    <view v-for="(item, index) in Brandlist" :id="item.initial" :key="item.initial">
                      <view class="Brandcss">
                        <view class="list-cell" v-for="(item1, index1) in item.data" :key="index1">
                          <view class="brandcss" @tap="searchBrand(item1)">
                            <view class="iconimg">
                              <image :src="'https://files.yzsheng.com/goodimg/brandimg/'+item1.bid+'.png'" mode="aspectFit"></image>
                            </view>
                            <view :class="xuanzebrand === item1.bid ? 'brannameZT' : 'branname'">{{item1.brand}}</view>
                            <view class="carnum">
                              {{item1.carNumber}}条
                            </view>
                            <view class="Spin">
                              <view :class="xuanzebrand === item1.bid ? 'ppjiantougo' : 'ppjiantou'">
                                <u-icon name="arrow-right" color="#9A9A9A" size="24rpx"></u-icon>
                              </view>
                            </view>
                          </view>
                          <view class="xieliecss" v-if="xuanzebrand === item1.bid">
                            <view class="xilie" v-for="(item2, index2) in CartypeList" :key="index2">
                              <view class="cartycss" @tap="XLsearchBrand(item2)">
                                <view :class="pzxuanzebrand === item2.carTypeId ? 'xilienamezt' : 'xiliename'">{{item2.carTypeName}}</view>
                                <view class="Spin">
                                  <view :class="pzxuanzebrand === item2.carTypeId ? 'ppjiantougo' : 'ppjiantou'">
                                    <u-icon name="arrow-right" color="#9A9A9A" size="24rpx"></u-icon>
                                  </view>
                                </view>
                              </view>
                              <view class="peizhibox">
                                <view class="peizhicss" v-if="pzxuanzebrand === item2.carTypeId">
                                  <view class="peizhi" v-for="(item3, index3) in configureList" :key="item3.id">
                                    <view :class="xuanzebrand ? 'peizhigo' : 'peizhixz'">
                                    </view>
                                    <view class="peizhiname" @click="Configuration(item3)">{{item3.name}}</view>
                                  </view>
                                </view>
                              </view>
                            </view>
                          </view>
                        </view>
                      </view>
                    </view>
                    <view class="floor">
                      <view v-for="(item,index) in ppindexlist" :data-id="item" :key="index" @tap="bindToView">
                        {{item}}
                      </view>
                    </view>
                  </scroll-view>
                </view>
              </u-dropdown-item>
              <u-dropdown-item title="地区">
                <view class="slot-content" style="background-color: #FFFFFF;">
                  <scroll-view scroll-y="true" style="height: 60vh;" :scroll-into-view="addtoView">
                    <view class="boxsds">
                      <view class="brandcss" @tap="searchAddressAll">
                        <view class="alladdress">全部地区</view>
                      </view>
                      <view v-for="(item, index) in Addresslist" :id="item.liststr" :key="item.liststr">
                        <view class="abcd">
                          {{item.liststr}}
                        </view>
                        <view class="Brandcss">
                          <view class="list-cell" v-for="(item1, index1) in item.data" :key="index1">
                            <view class="brandcss" @tap="searchAddress(item1)">
                              <view class="area">{{item1.name}}</view>
                            </view>
                          </view>
                        </view>
                      </view>
                      <view class="floor">
                        <view v-for="(item,index) in addindexlist" :data-id="item" :key="index" @tap="addressToView">
                          {{item}}
                        </view>
                      </view>
                    </view>
                  </scroll-view>
                </view>
              </u-dropdown-item>
              <u-dropdown-item title="筛选">
                <view class="slot-content">
                  <view class="Merctype">
                    商家类型
                  </view>
                  <view class="item-box">
                    <view class="item" :class="[item.active ? 'active' : '']" @tap="tagClick(index)" v-for="(item, index) in list"
                      :key="index">
                      {{item.label}}
                    </view>
                  </view>
                  <view class="item-asce">
                    <view class="item" :class="[item.active ? 'active' : '']" @tap="AscClick(index)" v-for="(item, index) in Ascending"
                      :key="index">
                      {{item.label}}
                    </view>
                  </view>
                  <view class="btnbox flex">
                    <view class="btn1" @click="Empty">
                      清空/默认
                    </view>
                    <view class="btn2" @click="closeDropdown">
                      确定
                    </view>
                  </view>
                </view>
              </u-dropdown-item>
            </u-dropdown>
          </view>
        </u-sticky>
        <view :class="stickyJudgment ? 'mainsyy' : 'mains'">
          <page-loading :show="showPage">
            <view class="li" @click="Carsourcedetails(item.id)" v-for="(item,index) in carSourceList" :key="index">
              <view class="good-img">
                <image :src="item.goodImg + '!idx'" mode="aspectFill"></image>
              </view>
              <view class="info">
                <view class="title">
                  <text class="brandtitle">{{item.brand_Name}}</text>
                  <text class="brandtitle">{{item.car_Type_Name}}</text>
                  <text class="bolue">{{item.configuration_Name}}</text>
                </view>
                <view class="price">¥{{item.bus_Price}}</view>
                <view class="zhidao-price">指导价：{{item.factory_Price}}</view>
              </view>
            </view>
            <view class="defaultMap" v-if="!carSourceList.length">
              <image src="https://files.yzsheng.com/bussiness/imgs/tu@2x.png"></image>
              <view class="texna">
                暂无更多信息，看看其他的吧
              </view>
            </view>
            <!-- <view style="height: 1120rpx;" v-if="carSourceList.length<10"></view> -->
          </page-loading>
        </view>
      </view>
    </view>



  </view>
</template>
<script src="./optionsCar.js"></script>
<style lang="scss" scoped>
  @import './optionsCar.scss';
</style>
